// ----------------------------------------------------------------------- //
//
// MODULE  : helper.h
//
// PURPOSE : Helper functions, etc - Definitions and constants
//
// CREATED : 12/28/00
//
// (c) 2000 LithTech, Inc.  All Rights Reserved
//
// ----------------------------------------------------------------------- //

#ifndef __HELPER_H__
#define __HELPER_H__


// Shared includes
#include "commandids.h"
#include "msgids.h"

// Engine includes
#include <ltcodes.h>


//-----------------------------------------------------------------------------
inline const char *LTRESULT_TO_STRING(LTRESULT x)
{
	return 
	x == LT_OK							? "LT_OK" : 
	x == LT_ERROR						? "LT_ERROR" : 
	x == LT_FINISHED					? "LT_FINISHED" : 
	x == LT_TRIEDTOREMOVECLIENTOBJECT	? "LT_TRIEDTOREMOVECLIENTOBJECT" : 
	x == LT_NOTINWORLD					? "LT_NOTINWORLD" : 
	x == LT_MISSINGFILE					? "LT_MISSINGFILE" : 
	x == LT_MISSINGWORLDMODEL			? "LT_MISSINGWORLDMODEL" : 
	x == LT_INVALIDMODELFILE			? "LT_INVALIDMODELFILE" : 
	x == LT_OBJECTNOTINWORLD			? "LT_OBJECTNOTINWORLD" :
	x == LT_CANTREMOVESERVEROBJECT		? "LT_CANTREMOVESERVEROBJECT" : 
	x == LT_CANTLOADGAMERESOURCES		? "LT_CANTLOADGAMERESOURCES" : 
	x == LT_CANTINITIALIZEINPUT			? "LT_CANTINITIALIZEINPUT" : 
	x == LT_MISSINGSHELLDLL				? "LT_MISSINGSHELLDLL" : 
	x == LT_INVALIDSHELLDLL				? "LT_INVALIDSHELLDLL" : 
	x == LT_INVALIDSHELLDLLVERSION		? "LT_INVALIDSHELLDLLVERSION" : 
	x == LT_CANTCREATECLIENTSHELL		? "LT_CANTCREATECLIENTSHELL" : 
	x == LT_UNABLETOINITSOUND			? "LT_UNABLETOINITSOUND" : 
	x == LT_MISSINGMUSICDLL				? "LT_MISSINGMUSICDLL" : 
	x == LT_INVALIDMUSICDLL				? "LT_INVALIDMUSICDLL" : 
	x == LT_UNABLETOINITMUSICDLL		? "LT_UNABLETOINITMUSICDLL" : 
	x == LT_CANTINITDIRECTPLAY			? "LT_CANTINITDIRECTPLAY" :
	x == LT_USERCANCELED				? "LT_USERCANCELED" : 
	x == LT_MISSINGWORLDFILE			? "LT_MISSINGWORLDFILE" : 
	x == LT_INVALIDWORLDFILE			? "LT_INVALIDWORLDFILE" : 
	x == LT_ERRORBINDINGWORLD			? "LT_ERRORBINDINGWORLD" : 
	x == LT_INVALIDSERVERPACKET			? "LT_INVALIDSERVERPACKET" : 
	x == LT_MISSINGSPRITEFILE			? "LT_MISSINGSPRITEFILE" : 
	x == LT_INVALIDSPRITEFILE			? "LT_INVALIDSPRITEFILE" : 
	x == LT_MISSINGMODELFILE			? "LT_MISSINGMODELFILE" : 
	x == LT_UNABLETORESTOREVIDEO		? "LT_UNABLETORESTOREVIDEO" : 
	x == LT_SERVERERROR					? "LT_SERVERERROR" : 
	x == LT_CANTCREATESERVER			? "LT_CANTCREATESERVER" : 
	x == LT_ERRORLOADINGRENDERDLL		? "LT_ERRORLOADINGRENDERDLL" : 
	x == LT_MISSINGCLASS				? "LT_MISSINGCLASS" : 
	x == LT_CANTCREATESERVERSHELL		? "LT_CANTCREATESERVERSHELL" : 
	x == LT_INVALIDOBJECTDLL			? "LT_INVALIDOBJECTDLL" : 
	x == LT_INVALIDOBJECTDLLVERSION		? "LT_INVALIDOBJECTDLLVERSION" : 
	x == LT_ERRORINITTINGNETDRIVER		? "LT_ERRORINITTINGNETDRIVER" : 
	x == LT_NOGAMERESOURCES				? "LT_NOGAMERESOURCES" : 
	x == LT_CANTRESTOREOBJECT			? "LT_CANTRESTOREOBJECT" : 
	x == LT_NODENOTFOUND				? "LT_NODENOTFOUND" : 
	x == LT_INVALIDPARAMS				? "LT_INVALIDPARAMS" : 
	x == LT_NOTFOUND					? "LT_NOTFOUND" : 
	x == LT_ALREADYEXISTS				? "LT_ALREADYEXISTS" : 
	x == LT_NOTCONNECTED				? "LT_NOTCONNECTED" : 
	x == LT_INSIDE						? "LT_INSIDE" : 
	x == LT_OUTSIDE						? "LT_OUTSIDE" : 
	x == LT_INVALIDDATA					? "LT_INVALIDDATA" : 
	x == LT_OUTOFMEMORY					? "LT_OUTOFMEMORY" : 
	x == LT_MISSINGPALETTE				? "LT_MISSINGPALETTE" : 
	x == LT_INVALIDVERSION				? "LT_INVALIDVERSION" : 
	x == LT_NOCHANGE					? "LT_NOCHANGE" : 
	x == LT_INPUTBUFFEROVERFLOW			? "LT_INPUTBUFFEROVERFLOW" : 
	x == LT_OVERFLOW					? "LT_OVERFLOW" : 
	x == LT_KEPTSAMEMODE				? "LT_KEPTSAMEMODE" : 
	x == LT_NOTINITIALIZED				? "LT_NOTINITIALIZED" : 
	x == LT_ALREADYIN3D					? "LT_ALREADYIN3D" : 
	x == LT_NOTIN3D						? "LT_NOTIN3D" : 
	x == LT_ERRORCOPYINGFILE			? "LT_ERRORCOPYINGFILE" : 
	x == LT_INVALIDFILE					? "LT_INVALIDFILE" : 
	x == LT_INVALIDNETVERSION			? "LT_INVALIDNETVERSION" : 
	x == LT_TIMEOUT						? "LT_TIMEOUT" : 
	x == LT_CANTBINDTOPORT				? "LT_CANTBINDTOPORT" : 
	x == LT_REJECTED					? "LT_REJECTED" : 
	x == LT_NOTSAMEGUID					? "LT_NOTSAMEGUID" :
	x == LT_UNSUPPORTED					? "LT_UNSUPPORTED" : 
	x == LT_INPROGRESS					? "LT_INPROGRESS" : 
	x == LT_NO3DSOUNDPROVIDER			? "LT_NO3DSOUNDPROVIDER" : 
	x == LT_YES							? "LT_YES" : 
	x == LT_NO							? "LT_NO" : 
	x == LT_MISSINGCURSORRESOURCE		? "LT_MISSINGCURSORRESOURCE" : 
	x == LT_ESCABORT					? "LT_ESCABORT" : 
	x == LT_ERRORINITTINGMPM			? "LT_ERRORINITTINGMPM" : 
	x == LT_BUFFERTOOSMALL				? "LT_BUFFERTOOSMALL" : 
	x == LT_ALREADYINITIALIZED			? "LT_ALREADYINITIALIZED" : 
	x == LT_RETRY						? "LT_RETRY" : 
	"<unknown LTRESULT>";
}


//-----------------------------------------------------------------------------
inline const char * LTEVENT_TO_STRING(uint32 x)
{
	return
	x == LTEVENT_DISCONNECT				? "LTEVENT_DISCONNECT" : 
	x == LTEVENT_SHUTDOWN				? "LTEVENT_SHUTDOWN" : 
	x == LTEVENT_RENDERINIT				? "LTEVENT_RENDERINIT" : 
	x == LTEVENT_RENDERTERM				? "LTEVENT_RENDERTERM" : 
	x == LTEVENT_RENDERALMOSTINITTED	? "LTEVENT_RENDERALMOSTINITTED" : 
	x == LTEVENT_LOSTFOCUS				? "LTEVENT_LOSTFOCUS" : 
	x == LTEVENT_GAINEDFOCUS			? "LTEVENT_GAINEDFOCUS" : 

	"<unknown LTEVENT>";
}


//-----------------------------------------------------------------------------
#ifdef __LTSERVEROBJ_H__

inline const char * ENGINEMESSAGEID_TO_STRING(uint32 x)
{
	return
	x == MID_PRECREATE					? "MID_PRECREATE" : 
	x == MID_OBJECTCREATED				? "MID_OBJECTCREATED" : 
	x == MID_UPDATE						? "MID_UPDATE" : 
	x == MID_TOUCHNOTIFY				? "MID_TOUCHNOTIFY" : 
	x == MID_LINKBROKEN					? "MID_LINKBROKEN" : 
	x == MID_MODELSTRINGKEY				? "MID_MODELSTRINGKEY" : 
	x == MID_CRUSH						? "MID_CRUSH" : 
	x == MID_LOADOBJECT					? "MID_LOADOBJECT" : 
	x == MID_SAVEOBJECT					? "MID_SAVEOBJECT" : 
	x == MID_AFFECTPHYSICS				? "MID_AFFECTPHYSICS" : 
	x == MID_PARENTATTACHMENTREMOVED	? "MID_PARENTATTACHMENTREMOVED" : 
	//x == MID_GETFORCEUPDATEOBJECTS		? "MID_GETFORCEUPDATEOBJECTS" : 
	x == MID_ACTIVATING					? "MID_ACTIVATING" : 
	x == MID_DEACTIVATING				? "MID_DEACTIVATING" : 
	x == MID_ALLOBJECTSCREATED			? "MID_ALLOBJECTSCREATED" : 
	"<unknown EngineMessageID>";
}

#endif

/*
//-----------------------------------------------------------------------------
inline const char * MESSAGEID_TO_STRING(uint8 x)
{
	return
	x == MSG_STARTPOINT_ROT				? "MSG_STARTPOINT_ROT" : 
	"<unknown MessageID>";
}


//-----------------------------------------------------------------------------
inline const char * COMMANDID_TO_STRING(int x)
{
	return
	x == CMD_MOVE_FORWARD				? "CMD_MOVE_FORWARD" : 
	x == CMD_MOVE_BACKWARD				? "CMD_MOVE_BACKWARD" : 
	x == CMD_MOVE_LEFT					? "CMD_MOVE_LEFT" : 
	x == CMD_MOVE_RIGHT					? "CMD_MOVE_RIGHT" : 
	x == CMD_MOVE_UP					? "CMD_MOVE_UP" : 
	x == CMD_MOVE_DOWN					? "CMD_MOVE_DOWN" : 
	x == CMD_ROLL_LEFT					? "CMD_ROLL_LEFT" : 
	x == CMD_ROLL_RIGHT					? "CMD_ROLL_RIGHT" : 
	x == CMD_YAW_LEFT					? "CMD_YAW_LEFT" : 
	x == CMD_YAW_RIGHT					? "CMD_YAW_RIGHT" : 
	x == CMD_PITCH_UP					? "CMD_PITCH_UP" : 
	x == CMD_PITCH_DOWN					? "CMD_PITCH_DOWN" : 
	x == CMD_RESET_VIEW					? "CMD_RESET_VIEW" : 
	x == CMD_ACTION1					? "CMD_ACTION1" : 
	x == CMD_ACTION2					? "CMD_ACTION2" : 
	x == CMD_ACTION3					? "CMD_ACTION3" : 
	x == CMD_ACTION4					? "CMD_ACTION4" : 
	x == CMD_SPECIAL1					? "CMD_SPECIAL1" : 
	x == CMD_SPECIAL2					? "CMD_SPECIAL2" : 
	x == CMD_MOUSE_BUTTON0				? "CMD_MOUSE_BUTTON0" : 
	x == CMD_MOUSE_BUTTON1				? "CMD_MOUSE_BUTTON1" : 
	x == CMD_MOUSE_BUTTON2				? "CMD_MOUSE_BUTTON2" : 
	x == CMD_CYCLE_PLAYER_STATE			? "CMD_CYCLE_PLAYER_STATE" : 
	x == CMD_CYCLE_CAMERA_STATE			? "CMD_CYCLE_CAMERA_STATE" : 
	x == CMD_TOGGLE_MENU				? "CMD_TOGGLE_MENU" : 
	x == CMD_QUIT						? "CMD_QUIT" : 
	"<unknown CommandID>";
}
*/

#endif	// __HELPER_H__
